import {Component, EventEmitter, Input, OnChanges, OnInit, Output, SimpleChanges} from '@angular/core';
import {DynamicComponent, DynamicComponentEvent} from '../dynamic-component/dynamic-component.interface';

@Component({
  selector: 'monitor-panel-dynamic',
  templateUrl: './monitor-panel-dynamic.component.html',
  styleUrls: ['./monitor-panel-dynamic.component.scss']
})
export class MonitorPanelDynamicComponent implements OnInit, OnChanges, DynamicComponent {
  @Input() monitors: {monitor: any, component: any}[];
  @Output() voted = new EventEmitter();
  context: any;
  data: any;
  dynamic: true;
  events: DynamicComponentEvent;
  constructor() { }

  ngOnInit() {
  }

  ngOnChanges(changes: SimpleChanges): void {
  }

  deleteMonitor(monitorId: number) {
    this.voted.emit(monitorId);
  }
}
